#pragma once

#include "Scene/Behavior/WorldBehavior.h"
#include "World/Chunk.h"

#include <unordered_set>

// class Chunk;

class LightChangeBehavior : public WorldBehavior
{
public:
  virtual void OnChunkLoaded(const Ref<Chunk> &chunk, World &world) override;
  virtual void OnBlockPlace(Player *player, glm::ivec3 blockPos, const BlockData *block, World &world) override;
  virtual void OnBlockBreak(Player *player, glm::ivec3 blockPos, const BlockData *block, World &world) override;

  void RefreshVerticeLightData(const Ref<Chunk> &chunk, World &world);

  void BFSLighting(const std::vector<LightSource> &worldPosition, World &world);

private:
  std::unordered_set<glm::ivec3, Util::HashIVec3> m_bfsVisitedSet;
};
